package com.ruoyi.marry.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.marry.domain.TMarryLovers;
import com.ruoyi.marry.mapper.TMarryLoversMapper;
import com.ruoyi.marry.service.ITMarryLoversService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 婚礼邀请表Service业务层处理
 *
 * @author user_marry
 * @date 2020-11-23
 */
@Service
public class TMarryLoversServiceImpl implements ITMarryLoversService {
    @Autowired
    private TMarryLoversMapper tMarryLoversMapper;

    /**
     * 查询婚礼邀请表
     *
     * @param id 婚礼邀请表ID
     * @return 婚礼邀请表
     */
    @Override
    public TMarryLovers selectTMarryLoversById(Long id) {
        return tMarryLoversMapper.selectTMarryLoversById(id);
    }

    /**
     * 查询婚礼邀请表列表
     *
     * @param tMarryLovers 婚礼邀请表
     * @return 婚礼邀请表
     */
    @Override
    public List<TMarryLovers> selectTMarryLoversList(TMarryLovers tMarryLovers) {
        return tMarryLoversMapper.selectTMarryLoversList(tMarryLovers);
    }

    /**
     * 新增婚礼邀请表
     *
     * @param tMarryLovers 婚礼邀请表
     * @return 结果
     */
    @Override
    public int insertTMarryLovers(TMarryLovers tMarryLovers) {
        tMarryLovers.setCreateTime(DateUtils.getNowDate());
        return tMarryLoversMapper.insertTMarryLovers(tMarryLovers);
    }

    /**
     * 修改婚礼邀请表
     *
     * @param tMarryLovers 婚礼邀请表
     * @return 结果
     */
    @Override
    public int updateTMarryLovers(TMarryLovers tMarryLovers) {
        tMarryLovers.setUpdateTime(DateUtils.getNowDate());
        return tMarryLoversMapper.updateTMarryLovers(tMarryLovers);
    }

    /**
     * 删除婚礼邀请表对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTMarryLoversByIds(Long[] ids) {
        return tMarryLoversMapper.deleteTMarryLoversByIds(ids);
    }

    /**
     * 删除婚礼邀请表信息
     *
     * @param id 婚礼邀请表ID
     * @return 结果
     */
    @Override
    public int deleteTMarryLoversById(Long id) {
        return tMarryLoversMapper.deleteTMarryLoversById(id);
    }
}
